package com.micro.ai.template.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * Agent指标实体
 *
 * @author micro-ai
 * @since 0.0.1
 */
@Data
@TableName("agent_metrics")
@Schema(description = "Agent指标")
public class AgentMetric {

    @TableId(value = "id", type = IdType.ASSIGN_ID)
    @Schema(description = "主键ID")
    private String id;

    @TableField("agent_id")
    @Schema(description = "Agent ID")
    private String agentId;

    @TableField("metric_date")
    @Schema(description = "指标日期")
    private LocalDate metricDate;

    @TableField("total_requests")
    @Schema(description = "总请求数")
    private Integer totalRequests;

    @TableField("successful_requests")
    @Schema(description = "成功请求数")
    private Integer successfulRequests;

    @TableField("failed_requests")
    @Schema(description = "失败请求数")
    private Integer failedRequests;

    @TableField("avg_processing_time_ms")
    @Schema(description = "平均处理时间(毫秒)")
    private BigDecimal avgProcessingTimeMs;

    @TableField("max_processing_time_ms")
    @Schema(description = "最大处理时间(毫秒)")
    private Integer maxProcessingTimeMs;

    @TableField("min_processing_time_ms")
    @Schema(description = "最小处理时间(毫秒)")
    private Integer minProcessingTimeMs;

    @TableField("total_token_usage")
    @Schema(description = "总Token使用量")
    private Integer totalTokenUsage;

    @TableField("error_rate")
    @Schema(description = "错误率")
    private BigDecimal errorRate;

    @TableField("created_at")
    @Schema(description = "创建时间")
    private LocalDateTime createdAt;
}

